#include "textpresenter.h"
#include <sstream>

TextPresenter::TextPresenter(QLabel *resultLabel)
    : ResultLabel(resultLabel)
{}

void TextPresenter::display(const Answer &an) {
    std::stringstream str;
    str << "Player" << an.Player << "'s ";

    switch (an.Limb) {
    case LK_LEFT_HAND: str << "left hand"; break;
    case LK_LEFT_LEG: str << "left leg"; break;
    case LK_RIGHT_HAND: str << "right hand"; break;
    case LK_RIGHT_LEG: str << "right leg"; break;
    }

    str << " to ";

    switch (an.Color) {
    case CK_RED: str << "red"; break;
    case CK_GREEN: str << "green"; break;
    case CK_BLUE: str << "blue"; break;
    case CK_YELLOW: str << "yellow"; break;
    }

    ResultLabel->setText(str.str().c_str());
}
